package com.leyou.auth.com.leyou.auth.utils;

import com.leyou.auth.dto.UserDetails;



public abstract class UserContext {
    private static final ThreadLocal<UserDetails> tl = new ThreadLocal<>();
    private static final ThreadLocal<String> tl2 = new ThreadLocal<>();

    public static void setJwt(String jwt) {
        tl2.set(jwt);
    }

    public static String getJwt() {
        return tl2.get();
    }

    public static void removeJwt() {
        tl2.remove();
    }

    public static void setUser(UserDetails user) {
        tl.set(user);
    }

    public static UserDetails getUser() {
        return tl.get();
    }

    public static void removeUser() {
        tl.remove();
    }
}